//
//  PlaceOrderSubDataModel.m
//  HAODE
//
//  Created by LiYinDi on 16/3/22.
//  Copyright © 2016年 reabam.com. All rights reserved.
//

#import "PlaceOrderSubDataModel.h"

@implementation PlaceOrderSubDataModel
+(instancetype)dataModelWithDict:(NSDictionary *)dict
{
    PlaceOrderSubDataModel *dataModel=[[self alloc] init];
    dataModel.imageUrlFull=[Global getJudgeTheErrorStr:dict[@"imageUrlFull"]];
    dataModel.itemCode=[Global getJudgeTheErrorStr:dict[@"itemCode"]];
    dataModel.itemId=[Global getJudgeTheErrorStr:dict[@"itemId"]];
    dataModel.itemName=[Global getJudgeTheErrorStr:dict[@"itemName"]];
    dataModel.itemType=[Global getJudgeTheErrorStr:dict[@"itemType"]];
    dataModel.maxCostPrice=[Global getJudgeTheErrorStr:dict[@"maxCostPrice"]];
    dataModel.minCostPrice=[Global getJudgeTheErrorStr:dict[@"minCostPrice"]];
    dataModel.costPrice=[Global getJudgeTheErrorStr:dict[@"costPrice"]];
    dataModel.maxPrice=[Global getJudgeTheErrorStr:dict[@"maxPrice"]];
    dataModel.minPrice=[Global getJudgeTheErrorStr:dict[@"minPrice"]];
    dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"dealPrice"]];
    dataModel.shopCartQty=[Global getJudgeTheErrorStr:dict[@"shopCartQty"]];
//    if ([[Global getType] isEqualToString:@"NeedOrder"]) {
//        NSString *str1=[NSString stringWithFormat:@"%d",TARGET_VERSION];
//        if ([str1 isEqualToString:@"4"]) {
//          
//            
//        }else{
//            dataModel.maxPrice=[Global getJudgeTheErrorStr:dict[@"maxPrice"]];
//            dataModel.minPrice=[Global getJudgeTheErrorStr:dict[@"minPrice"]];
//            dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"dealPrice"]];
//            
//        }
//
//    }else{
//    
//        dataModel.maxPrice=[Global getJudgeTheErrorStr:dict[@"maxPrice"]];
//        dataModel.minPrice=[Global getJudgeTheErrorStr:dict[@"minPrice"]];
//        dataModel.salePrice=[Global getJudgeTheErrorStr:dict[@"dealPrice"]];
//
//    }
   // dataModel.dealPrice=dict[@"dealPrice"];
    dataModel.invQty=[Global getJudgeTheErrorStr:dict[@"invQty"]];
    dataModel.specType=[Global getJudgeTheErrorStr:dict[@"specType"]];
    dataModel.itemType= [Global getJudgeTheErrorStr:dict[@"itemType"]];
    return dataModel;
}
-(void)setSpecCount:(NSString *)specCount
{
    _specCount=specCount?specCount:0;
}
@end
